<template>
	<view>
		<view class="bditem">
			<view>单位名称</view>
			<view>{{kcxx.unit}}</view>
		</view>
		<view class="bditem">
			<view>项目名称</view>
			<view>{{kcxx.buildname}}</view>
		</view>
		<view class="bditem">
			<view>联系人</view>
			<view>{{kcxx.contacts}}</view>
		</view>
		<view class="bditem">
			<view>联系电话</view>
			<view>{{kcxx.tel}}</view>
		</view>
		<view class="bditem">
			<view>勘察时间</view>
			<view><picker mode="date" @change="gnsj">
				<view>{{dqsj}}</view>
			</picker></view>
		</view>
		<view class="bditem" style="justify-content: space-between;margin: 30rpx 0;">
			<text>现场勘察意见</text>
			<view><checkbox-group @change="sffs">
				<label>
					<checkbox :checked="sfxz"/><text>是否发送勘察意见</text>
				</label>
			</checkbox-group></view>
		</view>
		<view class="bditem" style="height: 200rpx;border-bottom: 1px solid #E4E4E4;">
			<textarea :disabled="!sfxz" :placeholder="!sfxz?'已禁用':'请输入监管意见'"></textarea>
		</view>
		<view class="bditem" style="border: none;margin: 30rpx 0;">附件</view>
		<view class="bditem"><image style="width: 202rpx;height: 206rpx;" src="../../static/imglq/xn.jpg"></image></view>
		<view class="stbt">
			<button @click="kctj">提交</button>
			<button @click="kcqx">取消</button>
		</view>
	</view>
</template>

<script>
	import {reactive,toRefs,onMounted} from 'vue'
	import {useStore} from 'vuex'
	import formatTime from '../../utils/xzatime'
	
	export default {
		setup(){
			const {state}=useStore();
			let data=reactive({
				kcxx:{},
				sfxz:false,
				dqsj:'',
				kctj(){
					uni.navigateTo({url:'/pages/slsy/jsts'})
				},
				kcqx(){
					uni.navigateTo({url:'/pages/slsy/jsts'})
				},
				sffs(){
					data.sfxz=!data.sfxz
				},
				gnsj(e){
					data.dqsj=e.target.value
				}
			})
			onMounted(()=>{
				data.kcxx=state.slapp.kcys
				let odata=new Date()
				data.dqsj=formatTime(odata).split(' ')[0]
			})
			return {...toRefs(data)}
		}
	}
</script>

<style lang="scss">
	.bditem {
		color: #666666;
		padding: 20rpx 30rpx;
		display: flex;
		border-bottom: 1px solid #E4E4E4;

		view {
			display: flex;
			align-items: center;
		}

		&>view:first-child{
			text-align: center;
			width: 130rpx;
			margin-right: 80rpx;
		}
		&>view:last-child{
			font-size: 30rpx;
		}
		textarea{
			width: 345*2rpx;
			height: 200rpx;
		}
	}
	.stbt{
		display: flex;
		margin: 30rpx 0;
		justify-content: space-around;
		button{
			height: 67rpx;
			width: 200rpx;
			color: white;
			line-height: 67rpx;
			font-size: 32rpx;
			margin: 0;
			border: none;
			background-color: #0079FE;
		}
	}
</style>
